import React, { Suspense, Fragment } from "react";
import {
  Redirect,
  Switch,
  Route,
  HashRouter,
} from "react-router-dom";
import { Spin } from "antd";

import VisualDrag from '@pages/VisualDrag'; //厂站管理-可视化拖拽
/**
 *
 * @param Component
 * @param props
 * @returns {*}
 * 路由拦截
 */

const onEnter = (Component, props) => {
  return (
    <Component {...props} />
  );
};

/**
 *
 * @returns {*}
 * @constructor
 * 路由管理
 */
const Routes = () => (
  <Suspense fallback={<Spin className="style-spin" />}>
    <HashRouter>
      <Switch>
        <Route
          path={"/visualdrag"}
          exact
          render={(props) => onEnter(VisualDrag, props)}
        />
        <Redirect from="*" to="/visualdrag" />
      </Switch>
    </HashRouter>
  </Suspense>
);

export default Routes;
